<!DOCTYPE html>
<!--
This is a starter template page. Use this page to start your new project from
scratch. This page gets rid of all links and provides the needed markup only.
-->
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>AdminLTE 2 | Starter</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  <link rel="stylesheet" href="/stylesheets/bootstrap.min.css">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="/stylesheets/font-awesome/css/font-awesome.min.css">
  <!-- Ionicons -->
  <link rel="stylesheet" href="/stylesheets/Ionicons/css/ionicons.min.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="/stylesheets/AdminLTE.min.css">
  <!-- AdminLTE Skins. We have chosen the skin-blue for this starter
        page. However, you can choose any other skin. Make sure you
        apply the skin class to the body tag so the changes take effect. -->
  <link rel="stylesheet" href="/stylesheets/skins/skin-blue.min.css">

  <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]>
  <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  <![endif]-->
</head>
<!--
BODY TAG OPTIONS:
=================
Apply one or more of the following classes to get the
desired effect
|---------------------------------------------------------|
| SKINS         | skin-blue                               |
|               | skin-black                              |
|               | skin-purple                             |
|               | skin-yellow                             |
|               | skin-red                                |
|               | skin-green                              |
|---------------------------------------------------------|
|LAYOUT OPTIONS | fixed                                   |
|               | layout-boxed                            |
|               | layout-top-nav                          |
|               | sidebar-collapse                        |
|               | sidebar-mini                            |
|---------------------------------------------------------|
-->
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
  <%- include("header.ejs") %>
  <!-- Left side column. contains the logo and sidebar -->
  <%- include("aside.ejs") %>
  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">

    <!-- Main content -->
    <section class="content container-fluid">

      <div class="box">
        <div class="box-header with-border">
          <h3 class="box-title">商品信息管理</h3>
          <button style="float:right">
            <a href="/pro/add">上架</a>
          </button>
          <button style="float:right">
            <a href="/pro/uploadXlsx">批量导入</a>
          </button>
          <form action="/pro/search" style="float:right">
            <input type="text" name="sKey">
            <button type="submit">
              <i class="fa fa-search"></i>
            </button>
          </form>
        </div>
        <!-- /.box-header -->
        <div class="box-body">
          <table class="table table-bordered">
            <tbody><tr>
              <th>序号</th>
              <th>图片</th>
              <th>名称</th>
              <th>品牌</th>
              <th>logo</th>
              <th>价格
                <a href="/pro/sort?price=1" class="fa fa-sort-amount-asc"></a>
                <a href="/pro/sort?price=-1" class="fa fa-sort-amount-desc"></a>
              </th>
              <th>销量
                <a href="/pro/sort?sales=1" class="fa fa-sort-amount-asc"></a>
                <a href="/pro/sort?sales=-1" class="fa fa-sort-amount-desc"></a>
              </th>
              <th>库存</th>
              <th>评分</th>
              <th>折扣</th>
              <th>描述</th>
              <th>操作</th>
            </tr>
            <% for(var i=0;i<data.length;i++){ %>
                <tr>
                  <td><%= (i+1) + num * page %></td>
                  <td><img src="<%= data[i].proImg %>" alt="" width=50></td>
                  <td><%= data[i].proName %></td>
                  <td><%= data[i].brand %></td>
                  <td><img src="<%= data[i].logo %>" alt="" width=50></td>
                  <td><%= data[i].price %></td>
                  <td><%= data[i].sales %></td>
                  <td><%= data[i].stock %></td>
                  <td><%= data[i].score %></td>
                  <td><%= data[i].discount %></td>
                  <td><%= data[i].describe %></td>
                  <td>
                    <button>
                      <a href="/pro/update?id=<%= data[i].proId %>">修</a>
                    </button>
                    <button>
                      <a href="/pro/del?id=<%= data[i].proId %>">删</a>
                    </button>
                  </td>
                </tr>
            <% } %>
          </tbody></table>
        </div>
        <!-- /.box-body -->
        <div class="box-footer clearfix">
          <ul class="pagination pagination-sm no-margin pull-right">
            <li><a href="#">«</a></li>
            <% for(var i=0;i<maxPage;i++){ %>
              <li class="<%= i===(page-0) ? 'active' : '' %>"><a href="/pro/page?p=<%= i %>"><%= i+1 %></a></li>
            <% } %>
            <li><a href="#">»</a></li>
          </ul>
        </div>
      </div>
    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->

  <!-- Main Footer -->
  <%- include("footer.ejs") %>

</div>
<!-- ./wrapper -->

<!-- REQUIRED JS SCRIPTS -->

<!-- jQuery 3 -->
<script src="/javascripts/jquery.min.js"></script>
<!-- Bootstrap 3.3.7 -->
<script src="/javascripts/bootstrap.min.js"></script>
<!-- AdminLTE App -->
<script src="/javascripts/adminlte.min.js"></script>

<!-- Optionally, you can add Slimscroll and FastClick plugins.
     Both of these plugins are recommended to enhance the
     user experience. -->
</body>
</html>